Skip to content

Conversation

@itsmeichigo
Copy link
Contributor

@itsmeichigo itsmeichigo commented Jul 31, 2025

Part of WOOMOB-619

Description

This PR continues the work in #15959 to improve the performance on the product list by loading simplified product objects instead of full ones.

Changes include:

  • Update ProductListItem with new stock-related properties needed for displaying on product list items.
  • Update selectFirstProductIfAvailable in product list to fetch full object for only the item at first index, not the whole list.
  • Update product list datasource to work with simplified objects.
  • Update the product list cell to accept simplified objects.

Some helpers added:

  • Add toListItem extension method for Product to allow product search list and paginated list selector to continue working with the full objects. This is to keep the scope of this PR small.
  • Make createStockText a String extension to be reusable across different types, not just ProductFormDataModel.

Testing steps

  • Log in to a test store.
  • Navigate to the Products tab and confirm that the product lis loaded correctly.

Testing information

Tested and confirmed on simulator iPhone 16 iOS 18.4.

Screenshots

No UI changes.


  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@itsmeichigo itsmeichigo added this to the 23.0 milestone Jul 31, 2025
@itsmeichigo itsmeichigo added feature: product details Related to adding or editing products, including Product Settings. feature: product list Related to the product list. Enhancement labels Jul 31, 2025
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Aug 1, 2025

App Icon📲 You can test the changes from this Pull Request in WooCommerce iOS Prototype by scanning the QR code below to install the corresponding build.

App NameWooCommerce iOS Prototype
Build Numberpr15966-39a54d1
Version22.9
Bundle IDcom.automattic.alpha.woocommerce
Commit39a54d1
Installation URL1i5gg6qjh2u28
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@itsmeichigo itsmeichigo marked this pull request as ready for review August 1, 2025 09:03
@itsmeichigo itsmeichigo removed the feature: product details Related to adding or editing products, including Product Settings. label Aug 1, 2025
Copy link
Contributor

@RafaelKayumov RafaelKayumov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Products, variations, bundles look fine.

Comment on lines 361 to 363
func listItem(at indexPath: IndexPath) -> T.ListItemType {
return controller.object(at: indexPath).toListItem()
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@dangermattic
Copy link
Collaborator

dangermattic commented Aug 5, 2025

2 Warnings
⚠️ This PR is larger than 300 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.
⚠️ This PR is assigned to the milestone 23.0. This milestone is due in less than 2 days.
Please make sure to get it merged by then or assign it to a milestone with a later deadline.

Generated by 🚫 Danger

@itsmeichigo
Copy link
Contributor Author

@RafaelKayumov I also added changes in this PR to use a separate type for product list on the view layer. Due to complications with batch product update, I added a workaround to get list items for the product list without using the generic results controller as discussed in #15959. Please take another look when you can.

cc @jaclync

Base automatically changed from woomob-619-xcode-warnings-performing-io-on-the-main-thread-can-cause to trunk August 7, 2025 01:18
@itsmeichigo itsmeichigo enabled auto-merge August 7, 2025 03:25
@itsmeichigo itsmeichigo merged commit fe04802 into trunk Aug 7, 2025
13 of 14 checks passed
@itsmeichigo itsmeichigo deleted the woomob-619-product-list-update branch August 7, 2025 03:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement feature: product list Related to the product list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants